const URL_FU =
  "https://www.fastmock.site/mock/def007e9d6195651eb6d27f46270feb9/home/api";

const http = {
  get(url) {
    return fetch(URL_FU + url)
      .then((response) => response.json())
      .then((res) => {
        return res;
      });
  },
  post(url, data) {
    return fetch(URL_FU + url, {
      body: JSON.stringify(data),
      headers: {
        "content-type": "application/json",
      },
      method: "POST",
    })
      .then((response) => response.json())
      .then((res) => {
        return res;
      });
  },
};

export default http;
